﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate.Validator.Constraints;

namespace Landscape.Business.Entities
{
    public class UserMaster
    {
        public UserMaster()
        {
            //this.ID = -1;
            this.ID = Guid.Empty;
            this.Resources = new List<SystemResourceMap>();
        }

        public virtual Guid ID
        { get; set; }
                
        public virtual Locations Location
        { get; set; }             

        [NotNullNotEmpty]
        [Length(Min=2, Max=255, Message="First name should have atleast 2 to 255 charectors.")]
        public virtual string FirstName
        { get; set; }

        [NotNullNotEmpty]
        [Length(Min = 2, Max = 255, Message = "Last name should have atleast 2 to 255 charectors.")]
        public virtual string LastName
        { get; set; }

        public virtual string Salutation
        { get; set; }

        [NotNullNotEmpty]
        [Length(Min = 2, Max = 255, Message = "Email should have atleast 2 to 255 charectors.")]
        [Email(Message = "E-mail id is not well formed.")]
        public virtual string EMail
        { get; set; }

        [Length(Min = 2, Max = 255, Message = "Phone number should have atleast 2 to 255 charectors.")]
        public virtual string PhoneNumber
        { get; set; }

        public virtual bool IsSystemAdmin
        { get; set; }

        public virtual bool IsDisabled
        { get; set; }

        public virtual bool IsDeleted
        { get; set; }

        public virtual Guid CreatedBy
        { get; set; }

        public virtual DateTime CreatedDate
        { get; set; }

        public virtual Guid UpdatedBy
        { get; set; }

        public virtual DateTime UpdatedDate
        { get; set; }        

        public virtual IList<SystemResourceMap> Resources
        { get; set; }

        public virtual UserIdentity Identity
        { get; set; } 
    }
}
